package com.rest.demo.jpademo.service.impl;

import com.rest.demo.jpademo.dao.IUserDaoJap;
import com.rest.demo.jpademo.entity.tUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Administrator
 * @decription
 * @Date 2017-11-14 14:47
 */
@Service
public class IUserServiceJap implements com.rest.demo.jpademo.service.IUserServiceJap {

    @Autowired
    private IUserDaoJap userDao;


    @Override
    public List<tUser> finaAllUser() {
        return userDao.findAll();
    }

    @Override
    public tUser findUserById(Integer id) {
        return userDao.findOne(id);
    }

    @Override
    public tUser saveUser(tUser userPo) {
        return userDao.save(userPo);
    }

    @Override
    public tUser updateUser(tUser userPo) {
        return userDao.save(userPo);
    }

    @Override
    public void deleteUser(Integer id) {
        userDao.delete(id);
    }
}
